<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="../../lib/layui/css/layui.css">
	<link rel="stylesheet" href="../../css/oksub.css">
	<meta charset="utf-8">
	<title>催办记录</title>
</head>
<style>
	.list-con {
		padding: 0 10px 15px 10px;
		margin-bottom: 20px;
	}

	.list-con .layui-table td,

	.layui-table-view,
	.layui-table[lay-skin=line],
	.layui-table[lay-skin=row] {
		border: none;
	}
	.list-con .layui-table tbody {
		color: #777777;
	}

	.list-con .layui-table tbody tr:hover,
	.layui-table[lay-even] tr:nth-child(even) {
		background-color: rgb(226, 226, 226);
		color: black;
		font-weight: bold;
	}
	.layui-table tr{
		border-bottom: 1px #e2e2e2 solid;
	}
</style>

<body>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>催办警情</legend>

		<div style="z-index: 9999; position: fixed ! important; right:50px; top: 15px;">
			<div id="refresh" style=" margin-right:10px;"
				 class="layui-btn layui-btn-normal layui-btn-radius">
				刷新
			</div>
			<div id="selectForm"  class="layui-btn layui-btn-normal layui-btn-radius">
				<i class="layui-icon layui-icon-search"></i>
			</div>
		</div>
	</fieldset>

	<!--数据表格-->
	<div class="list-con">
	<table class="layui-hide" id="tableId" lay-filter="tableId"></table>
	</div>
</body>
<script src="../../lib/layui/layui.js"></script>
<script src="../../js/jquery.min.js"></script>
<script src="../../js/application.js"></script>
<script>
	layui.use([ "table","laydate",'okLayer',"okNprogress"], function () {
		let $ = layui.jquery;
		let table = layui.table;
		let laydate = layui.laydate;
		let okLayer = layui.okLayer;
		let okNprogress = layui.okNprogress;
        //搜索
		$("#selectForm").on('click', selectForm)
		function selectForm(){
			okLayer.open("查询条件", "selectForm.html", "35%", "60%", function (layero) {
				let iframeWin = window[layero.find("iframe")[0]["name"]];
				//iframeWin.initForm(initData.internshipId);
			}, function () {
				//根据子页面传过来的查询参数进行查询
				var caseId = window.document.caseId;
				var procLevel = window.document.procLevel;
				var caseDescription = window.document.caseDescription;
				var startTime = window.document.startTime;
				var endTime = window.document.endTime;
				var isChange=window.document.isChange;
				window.document.isChange=0
				if(isChange!=1){
					return
				}
				articleTable.reload({
					url: mainUri + "/vBeUrging/getVBeUrgingByDepartmentOrTime",
					where: {
						caseId: caseId, procLevel: procLevel, caseDescription: caseDescription,
						startTime: startTime, endTime: endTime
					},
				})
			})
		}
		//日期
		laydate.render({
			elem: '#date1'
		});
		laydate.render({
			elem: '#date2'
		});
        //处理中的警情展示
		let articleTable = table.render({
			elem: "#tableId",
			url: mainUri+"/vBeUrging/getVBeUrgingByDepartment",
			toolbar: true,
			cols: [[
				{ field: "processId", title: "指派编号" ,hide:true},
				{ field: "caseId", title: "警情编号",width:150 },
				{ field: "caseDescription", title: "警情描述",width:600},
				{ field: "nFullName", title: "处理者" ,width:80},
				{ field: "procLevel", title: "督办级别", width: 90,templet:function(d){
						if (d.procLevel == "一级") {
							return "<div style='color:#d92d29;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else if (d.procLevel == "二级") {
							return "<div style='color:#f09614;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else if (d.procLevel == "三级") {
							return "<div style='color:#fae600;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else{
							return "<div style='color:#478f43;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						}
					}},
				{ field: "procperiod", title: "处理时长(日)", width: 100},
				{ field: "uRoleName", title: "催办者",width:80,templet:function(d){
					return d.uRoleName+"("+d.uRoleName+")"
					}
				},
				{ field: "urgingContent", title: "催办内容",width:230},
				{ field: "urgingTime", title: "催办时间",width:150},
				{ field: "staticName", title: "当前状态"}
			]],
			page: {
				layout: ['prev', 'page', 'next', 'skip', 'count'],
				groups: 3,
				limit: 15,
				theme: '#1E9FFF',
			},
		});

		//监听行单击事件（双击事件为：rowDouble）
		table.on('row(tableId)', function (obj) {
			var data = obj.data;
			let uri="urging.html?processid="+data.processId+"&caseid="+data.caseId;
			show(uri);
			//标注选中样式
			obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
		});
        //刷新
		$("#refresh").on('click',function(){
			articleTable.reload({
				url: mainUri+"/vBeUrging/getVBeUrgingByDepartment"
			})
		})
        //弹窗设置
		function show(uri) {
			window.open (uri,'newwindow','width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+ ', top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no')
		}

	})
</script>

</html>